;Assembler header file for FileSwitch
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:01:38 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

        [       :LNOT: :DEF: FileSwitch_Hdr
        GBLS    FileSwitch_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
Error_FileSwitchNoClaim         *       &400
Error_BadFSControlReason        *       &401
Error_BadOSFileReason           *       &402
Error_BadOSArgsReason           *       &403
Error_BadOSGBPBReason           *       &404
Error_BadModeForOSFind          *       &405
Error_NoRoomForTransient        *       &406
Error_ExecAddrNotInCode         *       &407
Error_ExecAddrTooLow            *       &408
Error_UnknownActionType         *       &409
Error_TooManyLevels             *       &40A
Error_NoSelectedFilingSystem    *       &40B
Error_CantRemoveFSByNumber      *       &40C
Error_UnalignedFSEntry          *       &40D
Error_UnsupportedFSEntry        *       &40E
Error_FSNotSpecial              *       &40F
Error_CoreNotReadable           *       &410
Error_CoreNotWriteable          *       &411
Error_BadBufferSizeForStream    *       &412
Error_NotOpenForReading         *       &413
Error_NotEnoughStackForFSEntry  *       &414
Error_NothingToCopy             *       &415
Error_NothingToDelete           *       &416
Error_FileSwitchCantBeKilledWhilstThreaded *       &417
Error_InvalidErrorBlock         *       &418
Error_FSFileTooBig              *       &419
Error_CantRMFasterFileSwitch    *       &41A
Error_InconsistentHandleSet     *       &41B
Error_IsAFile                   *       &41C
Error_BadFileType               *       &41D
Error_LibrarySomewhereElse      *       &41E
Error_PathIsSelfContradictory   *       &41F
Error_WasntDollarAfterDisc      *       &420
Error_NotEnoughMemoryForWildcardResolution *       &421
Error_NotEnoughStackForWildcardResolution *       &422
Error_DirWantedFileFound        *       &423
Error_NotFound                  *       &424
Error_MultipartPathUsed         *       &425
Error_RecursivePath             *       &426
Error_MultiFSDoesNotSupportGBPB11 *       &427
Error_FileSwitchDataLost        *       &428
Error_TooManyErrorLookups       *       &429
Error_MessageFileBusy           *       &42A
Error_PartitionBusy             *       &42B
FileSwitch_FSNumberNone         *       &0
FileSwitch_FSNumberROMFS        *       &3
FileSwitch_FSNumberNETFS        *       &5
FileSwitch_FSNumberADFS         *       &8
FileSwitch_FSNumberNETPRINT     *       &C
FileSwitch_FSNumberNull         *       &D
FileSwitch_FSNumberPrinter      *       &E
FileSwitch_FSNumberSerial       *       &F
FileSwitch_FSNumberVDU          *       &11
FileSwitch_FSNumberRAWVDU       *       &12
FileSwitch_FSNumberKBD          *       &13
FileSwitch_FSNumberRAWKBD       *       &14
FileSwitch_FSNumberDESKFS       *       &15
FileSwitch_FSNumberRAMFS        *       &17
FileSwitch_FSNumberRISCIXFS     *       &18
FileSwitch_FSNumberStreamer     *       &19
FileSwitch_FSNumberSCSIFS       *       &1A
FileSwitch_FSNumberDigitiser    *       &1B
FileSwitch_FSNumberScanner      *       &1C
FileSwitch_FSNumberMULTIFS      *       &1D
FileSwitch_FSNumberNFS          *       &21
FileSwitch_FSNumberCDFS         *       &25
FileSwitch_FSNumberDOSFS        *       &2B
FileSwitch_FSNumberRESOURCEFS   *       &2E
FileSwitch_FSNumberPIPEFS       *       &2F
FileSwitch_FSNumberDEVICEFS     *       &35
FileSwitch_FSNumberParallel     *       &36
FileSwitch_FSNumberSPARKFS      *       &42
FileSwitch_FSNumberPCCARDFS     *       &59
FileSwitch_FSNumberMEMFS        *       &5B
FileSwitch_FSNumberSHAREFS      *       &63
FileSwitch_FSNumberLANMAN       *       &66
FileSwitch_FSNumberOMNIPRINT    *       &68
FileSwitch_FSNumberRSDFS        *       &6C
FileSwitch_FSNumber             *       &FF
FileSwitch_FSOpenFileLimit      *       &FF00
FileSwitch_FSReadOnly           *       &10000
FileSwitch_HasExtraFlags        *       &20000
FileSwitch_NoFileEntries        *       &40000
FileSwitch_NoSaveEntry          *       &80000
FileSwitch_NoLoadEntry          *       &100000
FileSwitch_ImplicitDirectories  *       &200000
FileSwitch_NeedsURDAndLib       *       &400000
FileSwitch_SupportsImage        *       &800000
FileSwitch_Reserved             *       &1000000
FileSwitch_SupportsFileInfo     *       &2000000
FileSwitch_SupportsStampNamed   *       &4000000
FileSwitch_NeedsFlush           *       &8000000
FileSwitch_NeedsCreate          *       &10000000
FileSwitch_SupportsEmptyNames   *       &20000000
FileSwitch_Interactive          *       &40000000
FileSwitch_SupportsSpecial      *       &80000000
FileSwitch_SupportsDirChange    *       &1
FileSwitch_NeedsCat             *       &2
FileSwitch_NeedsEx              *       &4
FileSwitch_SupportsIOCtl        *       &8
FileSwitch_NotFound             *       &0
FileSwitch_IsFile               *       &1
FileSwitch_IsDir                *       &2
FileSwitch_IsImage              *       &3
FileSwitch_AttrOwnerRead        *       &1
FileSwitch_AttrOwnerWrite       *       &2
FileSwitch_AttrOwnerSpecial     *       &4
FileSwitch_AttrOwnerLocked      *       &8
FileSwitch_AttrWorldRead        *       &10
FileSwitch_AttrWorldWrite       *       &20
FileSwitch_AttrWorldSpecial     *       &40
FileSwitch_AttrWorldLocked      *       &80
Error_NotSupported              *       &F8
Error_FSWriteOnly               *       &FA
Error_FSReadOnly                *       &FC

;Symbols for structure offsets and sizes
                                ^       0
                                #       Byte
FileSwitch_FSNo                 *       @

                                ^       0
                                #       Bits
FileSwitch_FSInfo               *       @

                                ^       0
                                #       Bits
FileSwitch_FSExtraInfo          *       @

                                ^       0
                                #       Int
FileSwitch_ObjectType           *       @

                                ^       0
                                #       Bits
FileSwitch_Attr                 *       @

                                ^       0
FileSwitch_InfoWords_date_and_time #       OS_DateAndTime
                                ^       0
FileSwitch_InfoWords_addrs_exec_addr #       Bits
FileSwitch_InfoWords_addrs_load_addr #       Bits
FileSwitch_InfoWords            *       @


;Symbols for SWI's and SWI reason codes
XOS_BGet                        *       &2000A
OS_BGet                         *       &A
   ;Entry
   ;  R1 = file (OS_F)
   ;Exit
   ;  R0 = c (Char)

XOS_BGetW                       *       &2000A
OS_BGetW                        *       &A
   ;Entry
   ;  R1 = file (OS_FW)
   ;Exit
   ;  R0 = c (Char)

BGetV                           *       &A
   ;Entry
   ;  R1 = file (OS_F)
   ;  R9 = &A
   ;Exit
   ;  R0 = c (Char)

BGetVW                          *       &A
   ;Entry
   ;  R1 = file (OS_FW)
   ;  R9 = &A
   ;Exit
   ;  R0 = c (Char)

XOS_BPut                        *       &2000B
OS_BPut                         *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_F)

XOS_BPutW                       *       &2000B
OS_BPutW                        *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_FW)

BPutV                           *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_F)
   ;  R9 = &B

BPutVW                          *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_FW)
   ;  R9 = &B

Service_StartUpFS               *       &12
   ;Entry
   ;  R1 = &12
   ;  R2 = fs_no (FileSwitch_FSNo)

Service_FSRedeclare             *       &40
   ;Entry
   ;  R1 = &40

Service_CloseFile               *       &68
   ;Entry
   ;  R1 = &68
   ;  R2 -> file_name (String)
   ;  R3 = count (Int)
   ;Exit
   ;  R3 = count_out (Int)

        ]
        END
